<extend name="Public:base" />
<!-- 网站标题 -->
<block name="title">添加选项</block>
<block name="appendheader">
	<!-- Validform_v5.3.2验证框架 -->
	<link rel="stylesheet" type="text/css" href="__PUBLIC__/Validform/css/Validform_v5.3.2.css"/>
	<script type="text/javascript" src="__PUBLIC__/Validform/js/Validform_v5.3.2_min.js"></script>
	<script type="text/javascript">
		$(function() {
			$("#WebMenu-2000").addClass('active');	//选中父菜单
			$("#WebMenu-2300").addClass('active');	//选中当前菜单
		});
		
		//切换问卷
		function change_project() {
			location.href = '__APP__?g={:GROUP_NAME}&m={:MODULE_NAME}&a={:ACTION_NAME}&formid='+$("#formid").val();
		}
		
		$(function() {
			var editor;
			var myform=$("#myform").Validform({
				tiptype:3,
				label:".label",
				showAllError:true,
				postonce:true,//开启二次提交防御
				ajaxPost:false,
				beforeSubmit:function(curform) {
					//在验证成功后，表单提交前执行的函数，curform参数是当前表单对象。
					lockScreen();
				},
				callback:function(data){
					$.Hidemsg();
				}
			});
			myform.addRule([
			{
				ele:"#type",
				datatype:"*1-50",
		        nullmsg:"请输入类别"
			},
			{
				ele:"#questionid",
				datatype:"*1-100",
				nullmsg:"请输入题项"
			}]);
		});
	</script>
</block>
<!-- 当前位置 -->
<block name="breadcrumb">
	<div class="page-header pull-left">
		<div class="page-title">添加题项描述</div>
	</div>
	<ol class="breadcrumb page-breadcrumb pull-left">
		<li><i class="fa fa-home"></i>&nbsp;<a href="__APP__?g=Admin">首页</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="#">基础数据</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li><a href="__APP__?g=Admin&m=Activity&a=index">题项描述管理</a>&nbsp;&nbsp;<i class="fa fa-angle-right"></i>&nbsp;&nbsp;</li>
		<li class="active">添加题项描述</li>
	</ol>
</block>
<!-- 网页主内容区 -->
<block name="main_content">
	<div class="row">
		<div class="col-md-12">
			<div class="panel panel-blue">
				<div class="panel-heading">添加题项描述</div>
				<div class="panel-body pan">
					<form id="myform" name="myform" action="__APP__?g=Admin&m=QuestionDesc&a=insert" method="post" class="form-horizontal form-seperated" >
						<div class="form-body">
							<div class="form-group">
								<label for="formid" class="col-md-2 control-label">问卷 <span class='require'>*</span></label>
								<div style="display:inline" class="col-md-7">
									<select id="formid" name="formid" class="form-control" onChange="change_project();">
										<option value="">请选择</option>
										<volist name="test_data" id="vo">
											<option value="{$vo.id}" <eq name="formid" value="$vo.id">selected</eq>>{$vo.title}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label for="questionid" class="col-md-2 control-label">题项 <span class='require'>*</span></label>
								<div style="display:inline" class="col-md-7">
									<select id="questionid" name="questionid" class="form-control">
										<option value="">请选择</option>
										<volist name="formdata.item_list" id="vo">
											<option value="{$vo.item_id}" <eq name="questionid" value="$vo.item_id"></eq>>[{$vo.type}][{$vo.code}]&nbsp;{$vo.question}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label for="type" class="col-md-2 control-label">类别 <span class='require'>*</span></label>
								<div style="display:inline" class="col-md-7">
									<select id="type" name="type" class="form-control" onChange="getCity()">
										<option value="">请选择</option>
										<volist name="type_list" id="vo">
											<option value="{$vo.id}" <eq name="vo.id" value="$data.type">selected</eq>>{$vo.name}</option>
										</volist>
									</select>
								</div>
							</div>
							<div class="form-group">
								<label for="desc" class="col-md-2 control-label">描述</label>
								<div class="col-md-7">
									<textarea id="desc" name="desc" class="form-control" style="height:380px;"></textarea>
								</div>
							</div>
							<div class="form-actions text-left pal">
								<div class="col-md-offset-2 col-md-7">
									<button type="submit" class="btn btn-primary">提交</button>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
									<button type="button" class="btn btn-green" onclick="history.go(-1);">取消</button>
								</div>
							</div>
						</div>
					</form>
				</div>
			</div>
		</div>
	</div>
</block>